#! /usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import time


def loop(deviceId):
    index = 0;
    if (deviceId == None):
        deviceId = "72de550a7d03"
    while True:
       for item in deviceId.split(","):
            f = os.popen(r"adb -s {} shell input swipe 100 850 100 100".format((item)), "r")
            result = f.read()
            index = 1 + index;
            print("{},{}".format(index, result))
            time.sleep(20)


# loop()

if __name__ == '__main__':
    newvariable642 = argparse.ArgumentParser()
    parser = newvariable642
    parser.add_argument('-d', '--d', nargs='?', help='deviceId')
    # args=parser.parse_args("--d 72de550a7d03,A5R7N18B09007926".split())
    args = parser.parse_args()
    loop(args.d)
    Flask
